<template>
  <view class="container">
    <!-- 使用自定义导航栏 -->
    <navigation-bar
      title="修改性别"
	  :item=JSON.stringify(item)
      @click-left="handleClickLeft"
      right-text="确定"
      @click-right="handleClickRight"
    />
    <!-- 页面内容 -->
    <view class="content">
		<view style="height: 2vh;"></view>
		<view style="width: 90%;margin: 0 auto;">
			

			<u-radio-group v-model="radiovalue1" placement="column" @change="groupChange" iconPlacement="right" borderBottom="true">
			    <u-radio :customStyle="{marginBottom: '8px'}"  shape="circle" v-for="(item, index) in radiolist1" :key="index" :label="item.name" :name="item.name" >
			    </u-radio>
			</u-radio-group>
		</view>
			

    </view>
  </view>
</template>

<script>
import NavigationBar from '@/components/SexNavigationBarTo.vue'; // 请根据你的实际路径进行调整

export default {
  components: {
    NavigationBar,
  },
  data(){
	return {
		item:{},
		form:{},
		// 基本案列数据
		          radiolist1: [{
		            name: '男',
		            disabled: false
		          },
		            {
		              name: '女',
		              disabled: false
		            }
		          ],
		          // u-radio-group的v-model绑定的值如果设置为某个radio的name，就会被默认选中
		          radiovalue1: '苹果',
				
		errMsg:false,
		passwordButton:false,
		newPassword:'',
		oldPassword:''
	}
  },
  onLoad(option) {
		this.form=JSON.parse(option.item)
		if(this.form.coachSex=='0'){
			this.radiovalue1 = '女'
		}
		if(this.form.coachSex=='1'){
			this.radiovalue1 = '男'
		}
		this.item = JSON.parse(option.item)
		
  },
  methods: {
	  groupChange(n) {
	          if(n== '男'){
				  this.item.coachSex ='1'
				  console.log(this.item)
			  }else if(n== '女'){
				  this.item.coachSex ='0'
				  console.log(this.item)
			  }
	        },
    handleClickLeft() {
      uni.navigateBack();
    },
    handleClickRight() {
      console.log('点击了右侧按钮');
      // ...处理逻辑...
    },
  },
};
</script>
<style>
	.container{
		width: 100%;
	}
</style>